from enum import Enum
from typing import Callable, Type, Any

from ctaf_core.ctaf_objects.base_event import BaseEvent

EventHandlerType: callable = Callable[[BaseEvent], Any]

class TaskTriggerEnum(Enum):
    CRON = "CronTrigger"
    INTERVAL = "IntervalTrigger"

def get_task_trigger_enum_by_value(value: str) -> TaskTriggerEnum | None:
    for item in TaskTriggerEnum:
        if item.value == value:
            return item
    return None